export const formOptions = [
  {
    label: '商品目录',
    type: 'cascader',
    key: 'brandName',
    span: 6,
    props: {
      placeholder: '请选择',
      props: {
        lazy: true,
        lazyLoad (node, resolve) {
          let id = 0
          const { level } = node
          setTimeout(() => {
            const nodes = Array.from({ length: level + 1 })
              .map(() => ({
                value: ++id,
                label: `选项${id}`,
                leaf: level >= 2
              }))
            // 通过调用resolve将子节点数据返回，通知组件数据加载完成
            resolve(nodes)
          }, 1000)
        }
      }

    }
  },
  {
    label: '商品状态',
    type: 'select',
    key: 'goodsState',
    span: 6,
    props: {
      placeholder: '请选择'
    },
    options: [
      {
        label: '全部',
        value: ''
      },
      {
        label: '新提交',
        value: '1'
      },
      {
        label: '审核通过',
        value: '2'
      },
      {
        label: '退回修改',
        value: '3'
      },
      {
        label: '商品下架',
        value: '4'
      },
      {
        label: '修改后提交',
        value: '5'
      }
    ]
  },
  {
    label: '商品名称',
    type: 'input',
    key: 'goodsName',
    span: 6,
    props: {
      placeholder: '请输入商品名称'
    }
  },
  {
    label: '品牌',
    type: 'input',
    key: 'brandName',
    span: 6,
    props: {
      placeholder: '请输入品牌'
    }
  },
  {
    label: '规格型号',
    type: 'input',
    key: 'typeNo',
    span: 6,
    props: {
      placeholder: '请输入规格型号'
    }
  },
  {
    label: '供应商名称',
    type: 'input',
    key: 'supplierName',
    span: 6,
    props: {
      placeholder: '请输入供应商名称'
    }
  },
  {
    label: '扶贫商品',
    type: 'select',
    key: 'isType',
    span: 6,
    props: {
      placeholder: '请选择'
    },
    options: [
      {
        label: '请选择',
        value: ''
      },
      {
        label: '否',
        value: '0'
      },
      {
        label: '是',
        value: '1'
      }
    ]
  }
]

export const btns = [
  'insert',
  // 'update',
  // 'delete',
  // 'import',
  // 'export',
  {
    title: '批量审核通过',
    icon: 'check',
    event: 'on-approved'
  },
  {
    title: '批量退回',
    icon: 'back',
    event: 'on-back'
  },
  {
    title: '批量设置扶贫',
    icon: 'setting',
    event: 'on-set'
  },
  {
    title: '批量取消扶贫',
    icon: 'refresh',
    event: 'on-cancel'
  }
]
